home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Gamer (Italian) 30
/
PC Gamer IT CD 30 1-2.iso
/
MOTS
/
GAMEDATA
/
RESOURCE
/
JKMRES.GOO
/
cog_pow_energy_m.cog
< prev
next >
Wrap
Text File
|
1998-02-25
|
2KB
|
96 lines
# Jedi Knight MOTHS Cog Script
#
# POW_ENERGY.COG
#
# POWERUP Script - Energy
#
# [YB, CYW, SRS]
#
# 01/09/98 [YB] Switched to powerup fast mode for multiplayer
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
symbols
thing powerup local
thing player local
int bin=11 local
sound pickupsnd=nrgpu1.wav local
sound respawnsnd=Activate01.wav local
flex amount local
int bin_contents=0 local
int autoselect_weapon=-1 local
int oldFlags local
message touched
message taken
message respawn
message timer
end
# ========================================================================================
code
touched:
player = GetSourceRef();
amount = GetInv(player, bin);
if (amount < GetInvMax(player, bin))
{
TakeItem(GetSenderRef(), -1);
call taken;
}
Return;
# ........................................................................................
taken:
powerup = GetSenderRef();
player = GetSourceRef();
// Print("Energy Cells");
jkPrintUNIString(player, bin);
// Do effects.
PlaySoundLocal(pickupsnd, 1, 0, 0);
AddDynamicTint(player, 0.0, 0.0, 0.2);
// store the old bin contents
bin_contents = GetInv(player, bin);
// Increment powerup amount.
ChangeInv(player, bin, 20.0);
// Check for Auto Reload
if(GetAutoReload() & 1)
{
if(!bin_contents)
{
if(!((GetAutoReload() & 2) && (GetWeaponBin(GetCurWeapon(player)) == jkGetMultiParam(1))))
{
// Try to autoselect and see if the best weapon is an energy cell weapon
autoselect_weapon = AutoSelectWeapon(player, 2);
if((autoselect_weapon == 2) || (autoselect_weapon == 3))
SelectWeapon(player, autoselect_weapon);
}
}
}
return;
# ........................................................................................
respawn:
PlaySoundThingLocal(respawnsnd, GetSenderRef(), 0.6, 5.0, 10.0, 0);
return;
end